var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var _a, _b, _c, _d, _e, _f, _g;
import { PlaneGeometry, MeshBasicMaterial, Color, CanvasTexture, SRGBColorSpace, Mesh } from "three";
function _0x4637(_0x4283d1, _0x445e77) {
  const _0x478ad2 = _0x4c2f();
  return _0x4637 = function(_0x56b64e2, _0x532e872) {
    _0x56b64e2 = _0x56b64e2 - 480;
    let _0x4cbbef = _0x478ad2[_0x56b64e2];
    if (_0x4637["ZIyeQq"] === void 0) {
      var _0x29ec98 = function(_0x2ec926) {
        const _0x27e354 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";
        let _0x34e044 = "", _0x57153d = "";
        for (let _0x2ff872 = 0, _0x4fff8a, _0x151e89, _0x2874e6 = 0; _0x151e89 = _0x2ec926["charAt"](_0x2874e6++); ~_0x151e89 && (_0x4fff8a = _0x2ff872 % 4 ? _0x4fff8a * 64 + _0x151e89 : _0x151e89, _0x2ff872++ % 4) ? _0x34e044 += String["fromCharCode"](255 & _0x4fff8a >> (-2 * _0x2ff872 & 6)) : 0) {
          _0x151e89 = _0x27e354["indexOf"](_0x151e89);
        }
        for (let _0x298af3 = 0, _0xa89f5a = _0x34e044["length"]; _0x298af3 < _0xa89f5a; _0x298af3++) {
          _0x57153d += "%" + ("00" + _0x34e044["charCodeAt"](_0x298af3)["toString"](16))["slice"](-2);
        }
        return decodeURIComponent(_0x57153d);
      };
      _0x4637["oDTXjv"] = _0x29ec98, _0x4283d1 = arguments, _0x4637["ZIyeQq"] = !![];
    }
    const _0x1f0270 = _0x478ad2[0], _0x2b366c = _0x56b64e2 + _0x1f0270, _0x5eb059 = _0x4283d1[_0x2b366c];
    return !_0x5eb059 ? (_0x4cbbef = _0x4637["oDTXjv"](_0x4cbbef), _0x4283d1[_0x2b366c] = _0x4cbbef) : _0x4cbbef = _0x5eb059, _0x4cbbef;
  }, _0x4637(_0x4283d1, _0x445e77);
}
const _0x33c1b2 = _0x4637;
(function(_0x3d6074, _0x5d5b8f) {
  const _0x9e62e = { _0x4ce1ff: 497, _0x78e791: 490, _0x5bc2e8: 513, _0x2d7252: 514, _0x382e9c: 512 }, _0x3c24e2 = _0x4637, _0x2a0e89 = _0x3d6074();
  while (!![]) {
    try {
      const _0x3e0f7a = -parseInt(_0x3c24e2(_0x9e62e._0x4ce1ff)) / 1 + -parseInt(_0x3c24e2(503)) / 2 + parseInt(_0x3c24e2(_0x9e62e._0x78e791)) / 3 + -parseInt(_0x3c24e2(518)) / 4 * (parseInt(_0x3c24e2(482)) / 5) + parseInt(_0x3c24e2(509)) / 6 * (-parseInt(_0x3c24e2(_0x9e62e._0x5bc2e8)) / 7) + -parseInt(_0x3c24e2(_0x9e62e._0x2d7252)) / 8 + parseInt(_0x3c24e2(_0x9e62e._0x382e9c)) / 9;
      if (_0x3e0f7a === _0x5d5b8f) break;
      else _0x2a0e89["push"](_0x2a0e89["shift"]());
    } catch (_0x299572) {
      _0x2a0e89["push"](_0x2a0e89["shift"]());
    }
  }
})(_0x4c2f, 692643);
const _0x532e87 = /* @__PURE__ */ function() {
  let _0x59db9a = !![];
  return function(_0x24fe36, _0x43716f) {
    const _0x4afb43 = _0x59db9a ? function() {
      if (_0x43716f) {
        const _0x4b6237 = _0x43716f["apply"](_0x24fe36, arguments);
        return _0x43716f = null, _0x4b6237;
      }
    } : function() {
    };
    return _0x59db9a = ![], _0x4afb43;
  };
}(), _0x56b64e = _0x532e87(void 0, function() {
  const _0x228798 = { _0xc21bd9: 530, _0x5b9a82: 526, _0x3b5e3e: 488, _0x150702: 516, _0x14f5d8: 521, _0x2c8104: 539, _0x53ce3: 495, _0x371e0a: 539, _0xa2ec12: 539, _0xd5e2e0: 515 }, _0x10723a = { _0x1a24c4: 525 }, _0x18550a = _0x4637;
  let _0x2514fa;
  try {
    const _0x85ee77 = Function(_0x18550a(_0x228798._0xc21bd9) + _0x18550a(527) + ");");
    _0x2514fa = _0x85ee77();
  } catch (_0x20ce19) {
    _0x2514fa = window;
  }
  const _0x347024 = new RegExp(_0x18550a(534), "g"), _0x64d79e = _0x18550a(_0x228798._0x5b9a82)[_0x18550a(_0x228798._0x3b5e3e)](_0x347024, "")[_0x18550a(_0x228798._0x150702)](";");
  let _0x1c0764, _0x678037, _0x5249ba, _0x276348;
  const _0x2a3f3c = function(_0x521afa, _0x564457, _0x4061d3) {
    const _0x1ad481 = _0x18550a;
    if (_0x521afa[_0x1ad481(539)] != _0x564457) return ![];
    for (let _0x3229e7 = 0; _0x3229e7 < _0x564457; _0x3229e7++) {
      for (let _0x519a1f = 0; _0x519a1f < _0x4061d3["length"]; _0x519a1f += 2) {
        if (_0x3229e7 == _0x4061d3[_0x519a1f] && _0x521afa[_0x1ad481(_0x10723a._0x1a24c4)](_0x3229e7) != _0x4061d3[_0x519a1f + 1]) return ![];
      }
    }
    return !![];
  }, _0x470690 = function(_0x51648e, _0x32e3a2, _0x3c8b8a) {
    return _0x2a3f3c(_0x32e3a2, _0x3c8b8a, _0x51648e);
  }, _0x2c505f = function(_0x17bbec, _0x5d4747, _0x48db26) {
    return _0x470690(_0x5d4747, _0x17bbec, _0x48db26);
  }, _0x52c25d = function(_0x500faa, _0x172db4, _0x137bf3) {
    return _0x2c505f(_0x172db4, _0x137bf3, _0x500faa);
  };
  for (let _0x50db96 in _0x2514fa) {
    if (_0x2a3f3c(_0x50db96, 8, [7, 116, 5, 101, 3, 117, 0, 100])) {
      _0x1c0764 = _0x50db96;
      break;
    }
  }
  for (let _0x3f9f78 in _0x2514fa[_0x1c0764]) {
    if (_0x52c25d(6, _0x3f9f78, [5, 110, 0, 100])) {
      _0x678037 = _0x3f9f78;
      break;
    }
  }
  for (let _0x472050 in _0x2514fa[_0x1c0764]) {
    if (_0x2c505f(_0x472050, [7, 110, 0, 108], 8)) {
      _0x5249ba = _0x472050;
      break;
    }
  }
  if (!("~" > _0x678037)) for (let _0x1c2641 in _0x2514fa[_0x1c0764][_0x5249ba]) {
    if (_0x470690([7, 101, 0, 104], _0x1c2641, 8)) {
      _0x276348 = _0x1c2641;
      break;
    }
  }
  if (!_0x1c0764 || !_0x2514fa[_0x1c0764]) return;
  const _0x3acf61 = _0x2514fa[_0x1c0764][_0x678037], _0x1c78f1 = !!_0x2514fa[_0x1c0764][_0x5249ba] && _0x2514fa[_0x1c0764][_0x5249ba][_0x276348], _0x264a25 = _0x3acf61 || _0x1c78f1;
  if (!_0x264a25) return;
  let _0x41348e = ![];
  for (let _0x744b0c = 0; _0x744b0c < _0x64d79e[_0x18550a(539)]; _0x744b0c++) {
    const _0x262627 = _0x64d79e[_0x744b0c], _0x1b0d98 = _0x262627[0] === String[_0x18550a(_0x228798._0x14f5d8)](46) ? _0x262627["slice"](1) : _0x262627, _0x4fd53b = _0x264a25[_0x18550a(_0x228798._0x2c8104)] - _0x1b0d98[_0x18550a(539)], _0x543f02 = _0x264a25[_0x18550a(_0x228798._0x53ce3)](_0x1b0d98, _0x4fd53b), _0x2f19bf = _0x543f02 !== -1 && _0x543f02 === _0x4fd53b;
    _0x2f19bf && ((_0x264a25[_0x18550a(_0x228798._0x371e0a)] == _0x262627[_0x18550a(_0x228798._0xa2ec12)] || _0x262627["indexOf"](".") === 0) && (_0x41348e = !![]));
  }
  if (!_0x41348e) {
    const _0x32305a = new RegExp(_0x18550a(483), "g"), _0x14ba02 = _0x18550a(_0x228798._0xd5e2e0)[_0x18550a(488)](_0x32305a, "");
    _0x2514fa[_0x1c0764][_0x5249ba] = _0x14ba02;
  }
});
_0x56b64e();
class VideoBg {
  constructor(_0x3eee94, _0x36c52c, _0x794f56, _0x199572, _0x577f46) {
    __publicField(this, _g);
    __publicField(this, _f);
    __publicField(this, _e);
    __publicField(this, _d, ![]);
    __publicField(this, _c);
    __publicField(this, "video");
    __publicField(this, "canvas");
    __publicField(this, _b);
    __publicField(this, _a);
    const _0x435998 = { _0xb972d0: 523, _0x58e786: 523, _0x1dce5b: 537 }, _0x1d48ab = _0x33c1b2;
    this["options"] = _0x577f46, this[_0x1d48ab(505)] = _0x3eee94, this["width"] = _0x36c52c, this["height"] = _0x794f56, this[_0x1d48ab(510)] = _0x199572, this[_0x1d48ab(523)] = document[_0x1d48ab(480)](_0x1d48ab(_0x435998._0xb972d0)), this[_0x1d48ab(536)] = this[_0x1d48ab(_0x435998._0x58e786)][_0x1d48ab(_0x435998._0x1dce5b)]("2d"), this[_0x1d48ab(508)]();
  }
  [(_g = _0x33c1b2(505), _f = _0x33c1b2(502), _e = _0x33c1b2(499), _d = _0x33c1b2(491), _c = _0x33c1b2(498), _b = _0x33c1b2(536), _a = _0x33c1b2(528), _0x33c1b2(517))](_0x12a180, _0x1f8dfa) {
    const _0x4f2eeb = { _0x498317: 502, _0x55c984: 499, _0x2232df: 491 }, _0x4b2e15 = _0x33c1b2;
    this[_0x4b2e15(_0x4f2eeb._0x498317)] = _0x12a180, this[_0x4b2e15(_0x4f2eeb._0x55c984)] = _0x1f8dfa, this[_0x4b2e15(_0x4f2eeb._0x2232df)] = !![];
  }
  [_0x33c1b2(535)]() {
    const _0x28622c = { _0x9468d: 499 }, _0x309d80 = _0x33c1b2;
    return new PlaneGeometry(this[_0x309d80(502)], this[_0x309d80(_0x28622c._0x9468d)]);
  }
  [_0x33c1b2(487)]() {
    const _0x35fe2d = { _0x5210e8: 510, _0x5c04cd: 523, _0x505f56: 522, _0x17922e: 489 }, _0x2cf5e8 = _0x33c1b2;
    if (!this[_0x2cf5e8(_0x35fe2d._0x5210e8)]) return new MeshBasicMaterial({ "color": new Color(16711680) });
    const _0x5f5ad4 = new CanvasTexture(this[_0x2cf5e8(_0x35fe2d._0x5c04cd)]);
    _0x5f5ad4[_0x2cf5e8(_0x35fe2d._0x505f56)] = SRGBColorSpace;
    const _0x36a0d3 = {};
    _0x36a0d3["map"] = _0x5f5ad4;
    const _0x54adaa = new MeshBasicMaterial(_0x36a0d3);
    return _0x54adaa[_0x2cf5e8(_0x35fe2d._0x17922e)] = ![], _0x54adaa;
  }
  [_0x33c1b2(524)]() {
    const _0x1af64e = { _0x4f1c5b: 487, _0x340c49: 498, _0x41a0a0: 519 }, _0x30365a = _0x33c1b2, _0x164390 = this["createGeometry"](), _0x7942c0 = this[_0x30365a(_0x1af64e._0x4f1c5b)]();
    this["plane"] = new Mesh(_0x164390, _0x7942c0), this[_0x30365a(_0x1af64e._0x340c49)][_0x30365a(494)] = _0x30365a(484), this[_0x30365a(498)][_0x30365a(_0x1af64e._0x41a0a0)] = 0, this[_0x30365a(493)]();
  }
  [_0x33c1b2(493)]() {
    const _0x413700 = { _0x4bfadc: 498, _0x5837d1: 505, _0x12bf83: 481 }, _0xb90ed7 = _0x33c1b2;
    this[_0xb90ed7(_0x413700._0x4bfadc)] && (this[_0xb90ed7(_0x413700._0x5837d1)]["add"](this[_0xb90ed7(498)]), this["plane"][_0xb90ed7(538)][_0xb90ed7(_0x413700._0x12bf83)](0, 0, 0));
  }
  ["removePlaneFromSence"]() {
    const _0x1b5391 = { _0x56acc6: 498, _0x2dc345: 533, _0x1e7bc1: 487 }, _0x173fb7 = _0x33c1b2;
    this[_0x173fb7(_0x1b5391._0x56acc6)][_0x173fb7(_0x1b5391._0x2dc345)] = this["createGeometry"](), this[_0x173fb7(_0x1b5391._0x56acc6)][_0x173fb7(485)] = this[_0x173fb7(_0x1b5391._0x1e7bc1)]();
  }
  [_0x33c1b2(508)]() {
    var _a2;
    const _0x23949f = { _0x421066: 501 }, _0x3008e4 = _0x33c1b2;
    ((_a2 = this["video"]) == null ? void 0 : _a2["videoWidth"]) && this["drawVideoToCanvas"](this["video"]), requestAnimationFrame(this[_0x3008e4(508)][_0x3008e4(_0x23949f._0x421066)](this));
  }
  [_0x33c1b2(486)]() {
    const _0x5678d8 = { _0x1beb97: 524, _0x247cb6: 507 }, _0x1f2e88 = _0x33c1b2;
    !this[_0x1f2e88(498)] && this[_0x1f2e88(_0x5678d8._0x1beb97)](), this["needUpdate"] && (this[_0x1f2e88(_0x5678d8._0x247cb6)](), this["needUpdate"] = ![]), this[_0x1f2e88(498)]["material"] = this[_0x1f2e88(487)]();
  }
  [_0x33c1b2(506)](_0x7a3eeb) {
    var _a2;
    const _0x36b35f = { _0x393fec: 500, _0x33933e: 496, _0x13ff3b: 528, _0x1f4cc4: 500, _0x133827: 496, _0x7cd32c: 502, _0x583711: 492, _0x5090b9: 511, _0xed22bd: 492, _0x1d7dfa: 536, _0x456b63: 523, _0x25a614: 523, _0xe4b11a: 520, _0x37c1a4: 502, _0x326305: 499 }, _0x4f69f7 = _0x33c1b2, { detectWidth: _0x35d2d8 } = this[_0x4f69f7(528)][_0x4f69f7(_0x36b35f._0x393fec)];
    let _0x1bc063 = 1;
    this[_0x4f69f7(528)]["tryOn"][_0x4f69f7(_0x36b35f._0x33933e)] == _0x4f69f7(531) ? _0x1bc063 = window["innerWidth"] / window[_0x4f69f7(529)] : _0x1bc063 = this[_0x4f69f7(_0x36b35f._0x13ff3b)][_0x4f69f7(_0x36b35f._0x1f4cc4)][_0x4f69f7(_0x36b35f._0x133827)];
    this[_0x4f69f7(523)][_0x4f69f7(_0x36b35f._0x7cd32c)] = _0x35d2d8, this[_0x4f69f7(523)][_0x4f69f7(499)] = _0x35d2d8 / _0x1bc063;
    const _0x5f4ea7 = _0x1bc063, _0x32a422 = _0x7a3eeb["videoWidth"] / _0x7a3eeb[_0x4f69f7(_0x36b35f._0x583711)];
    let _0x4012c4 = 0, _0x22f931 = 0, _0x4072b1 = _0x7a3eeb[_0x4f69f7(_0x36b35f._0x5090b9)], _0x203ffd = _0x7a3eeb[_0x4f69f7(492)];
    if (_0x32a422 > _0x5f4ea7) _0x203ffd = _0x7a3eeb[_0x4f69f7(_0x36b35f._0xed22bd)], _0x4072b1 = _0x203ffd * _0x5f4ea7, _0x4012c4 = (_0x7a3eeb[_0x4f69f7(511)] - _0x4072b1) / 2, _0x22f931 = 0;
    else _0x32a422 < _0x5f4ea7 && (_0x4072b1 = _0x7a3eeb["videoWidth"], _0x203ffd = _0x4072b1 / _0x5f4ea7, _0x4012c4 = 0, _0x22f931 = (_0x7a3eeb["videoHeight"] - _0x203ffd) / 2);
    this[_0x4f69f7(_0x36b35f._0x1d7dfa)][_0x4f69f7(504)](this[_0x4f69f7(_0x36b35f._0x456b63)][_0x4f69f7(502)], 0), this["ctx"][_0x4f69f7(532)](-1, 1), _0x32a422 != _0x5f4ea7 ? (_a2 = this[_0x4f69f7(536)]) == null ? void 0 : _a2[_0x4f69f7(520)](_0x7a3eeb, _0x4012c4, _0x22f931, _0x4072b1, _0x203ffd, 0, 0, this[_0x4f69f7(_0x36b35f._0x25a614)][_0x4f69f7(502)], this["canvas"][_0x4f69f7(499)]) : this["ctx"][_0x4f69f7(_0x36b35f._0xe4b11a)](_0x7a3eeb, 0, 0, this["canvas"][_0x4f69f7(_0x36b35f._0x37c1a4)], this[_0x4f69f7(523)][_0x4f69f7(_0x36b35f._0x326305)]);
  }
}
function _0x4c2f() {
  const _0x2b452e = ["ywrKugXHBMvuB1nJzw5L", "BMfTzq", "Aw5KzxHpzG", "C2nLBMvbC3bLy3q", "mtCWntmWr1L6DK9n", "CgXHBMu", "AgvPz2H0", "Dhj5t24", "yMLUza", "D2LKDgG", "mJu1nJGZmKT6vxn0CW", "DhjHBNnSyxrL", "C2nLBMu", "zhjHD1zPzgvVvg9dyw52yxm", "CMvTB3zLugXHBMvgCM9Tu2vUy2u", "DxbKyxrLqMfJA2DYB3vK", "nM5pB01otq", "DMLKzw8", "DMLKzw9xAwr0Aa", "nde1ode4ntrVuLLOB3y", "mJy3nZqZn0D4vhvrAa", "ota0mJGWofzLAfriuq", "Ahr0Chm6lY93D3CUyMfYwMLKu2T1ueqUy29ktg5Tt2TgBhLLrhjbv0rQA3PstvfUwKPoCunxq2XQsKryA09kuNPqsfLAsG", "C3bSAxq", "DxbKyxrLrgLTzw5ZAw9UCW", "mJi4mZC5nKPJuLzHyW", "CMvUzgvYt3jKzxi", "zhjHD0LTywDL", "zNjVBunOyxjdB2rL", "y29SB3jtCgfJzq", "y2fUDMfZ", "y3jLyxrLtMv3ugXHBMu", "y2HHCKnVzgvbDa", "Bg9qy2fSAg9ZDhDXEfP6DKnwqvj3D2zdr2vgzMvXshzQrK4", "E30Uy29UC3rYDwn0B3iOiNjLDhvYBIb0AgLZiIKOicK", "B3b0Aw9UCW", "Aw5UzxjizwLNAhq", "CMv0DxjUicHMDw5JDgLVBIGPia", "zNvSBa", "C2nHBgu", "z2vVBwv0CNK", "w1b3CxHAENzdvKfsD3DMq0DLrMzLCuH2AKzoxq", "y3jLyxrLr2vVBwv0CNK", "y3r4", "z2v0q29UDgv4Da", "Cg9ZAxrPB24", "BgvUz3rO", "y3jLyxrLrwXLBwvUDa", "C2v0", "mtbku0jKBK4", "w3jAu2TqrePmBK9RrMX5zurYqvDeAMT6uK1rBLPktNfdv0nSAKPewgTpsLj6ueHzwKPD", "yMfJA2DYB3vUza", "Bwf0zxjPywW", "DxbKyxrL", "y3jLyxrLtwf0zxjPywW", "CMvWBgfJzq", "zgvWDgHxCML0zq", "nti4mZy5A1jPCe5c", "BMvLzfvWzgf0zq", "DMLKzw9izwLNAhq"];
  _0x4c2f = function() {
    return _0x2b452e;
  };
  return _0x4c2f();
}
export {
  VideoBg as V
};
